import {bannerList} from '../../../request/api'

const state={
    bannerlist:[]
}

const getters ={
    getBannerList(state){
        return state.bannerlist
    }
}

const mutations ={
    REQ_LIST(state,payload){
        state.bannerlist = payload
    }
}

const actions = {
    bannerListAction({commit}){
        bannerList()
        .then(res=>{
            console.log(res,'轮播图列表');
            commit('REQ_LIST',res.list)
        })
    }
}

export default {
    state,
    getters,
    mutations,
    actions,
    namespaced:true
}